'use strict'
require('page/common/nav-simple/index.js');
require('page/common/nav/index.js');
require('page/common/header/index.js');
var _utils         = require('util/util.js');
var navSide    	   = require('page/common/nav-side/index.js');
var templateBanner = require('./banner.string');
require('./index.css');
//点击到那个页面那个页面变色
navSide.init({
	name:'about'
});


require('util/slider/unslider.min.js');
$(function() {
    //寻人banner的html
	var bannerHtml = _utils.renderHtml(templateBanner);
	$('.banner-con').html(bannerHtml);
    //初始化banner
    var $slider    = $('.banner').unslider({
    speed: 500,               //  The speed to animate each slide (in milliseconds)
    delay: 3000,              //  The delay between slide animations (in milliseconds)
    complete: function() {},  //  A function that gets called after every slide animation
    keys: true,               //  Enable keyboard (left, right) arrow shortcuts
    dots: true,               //  Display dot navigation
    fluid: false              //  Support responsive design. May break non-responsive designs
});
     //前一张和后一张操作的事件绑定

     $('.banner-con .banner-arrow').click(function(){

        var forward = $(this).hasClass('prev') ? 'prev' : 'next';
        $slider.data('unslider')[forward]();

     });
});
